﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aluetjen.EmailService.Domain.Models.Endpoints;
using Aluetjen.EmailService.Domain.Models.Message;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;

namespace Aluetjen.EmailService.Infrastructure.Persistence.Mappings
{
    public class MailMessageMappingOverrides : IAutoMappingOverride<MailMessage>
    {
        public void Override(AutoMapping<MailMessage> mapping)
        {
            mapping.IgnoreProperty(x => x.BodyEncoding);
            mapping.IgnoreProperty(x => x.SubjectEncoding);
            mapping.IgnoreProperty(x => x.HeadersEncoding);
        }
    }

    public class EndpointMappingOverrides : IAutoMappingOverride<Endpoint>
    {
        public void Override(AutoMapping<Endpoint> mapping)
        {
            mapping.Map(m => m.Enabled, "[Open]");
        }
    }
}
